import os, re

pattern = r"1[3-9]\d{9}"   #正则表达式规则

file_cont = ""
file_path = os.path.join(os.getcwd(), "01-exercise/21-40/data/webpage_data.txt")

# 修复编码参数格式问题，作用是获取日期及每天销售额，以date_sale[date] = float(sale_number)字典形式存储
with open(file_path, 'r', encoding='utf-8') as fin:
    file_cont = fin.read()
results = re.findall(pattern, file_cont)
print(len(results))

for result in results:
    print(result)